﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>

    <script src="~/Scripts/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#checkboxall').click(function () {
                if ($(this).is(":checked"))
                    $('.chkCheckBoxId').prop('checked', true);
                else
                    $('.chkCheckBoxId').prop('checked', false);
            });
        });
    </script>
</head>
<body>
    <div> 
        @using (Html.BeginForm("Index", "Product", FormMethod.Post))
        {
            <input type="submit" value="Delete" onclick="return confirm('ban có chắc xóa tất cả' )" />
            <br/>
        <table cellpadding="2" cellspacing="2" border="1" class="table table-hover">
            <tr>
                <th><input type="checkbox" id="checkboxall" /></th>
                <th>Id</th>
                <th>Name</th>
                <th>UnitPrice</th>
                <th>Image</th>
                <th>ProductDate</th>
                <th></th>
             </tr>
            @foreach (var produc in ViewBag.ListProduct)
            {
                <tr>
                    <td><input type="checkbox" class="chkCheckBoxId" name="productId" value="@produc.Id"/></td>
                    <td>@produc.Id</td>
                    <td>@produc.Name</td>
                    <td>@produc.UnitPrice</td>
                    <td>@produc.Image</td>
                    <td>@produc.ProductDate</td>
                    <td>
                    <input type="submit" value="Delete" onclick="return confirm('ban có chắc xóa' + '@produc.Name')" /></td>
                </tr>
                }
        </table>
      
        }

    </div>
</body>
</html>
